import axios from "axios";
// 创建一个axios实例
const service=axios.create({
    timeout:3000,
    baseURL:'/api',
    headers: {'Content-Type':'application/json'}
})
//设置拦截器
//添加请求拦截器
service.interceptors.request.use(
    config => {
        return config
    },
    err => {
        console.log(err)
    }
)

service.interceptors.response.use(
    response => {
        const res = {}
        res.status = response.status
        res.data = response.data
        return res
    },
    err => console.log(err)
)

export default  service